package com.scwatch.core.repository;

import com.scwatch.common.orm.Limitable;
import com.scwatch.core.domain.Program;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;

import java.util.List;

/**
 * Created by rh006 on 2017/7/24.
 */
public interface ProgramDao extends Repository<Program, Integer> {

    public Page<Program> findAll(Specification<Program> spec,
                                 Pageable pageable);

    public List<Program> findAll(Specification<Program> spec,
                                 Limitable limitable);

    public Program findOne(Integer id);

    public Program save(Program bean);

    public void delete(Program bean);

  /* public List<Program> findByStatus(int status);*/
    @Query("from Program pm")
    public  List<Program> findAll();

}
